import {KnowledgeBaseRes} from "./knowledgeBaseType";
import {PluginRes} from "./pluginType";
import {ConservationRes} from "./conservationType";


export interface Agent {
    name: string;
    description: string;
    cover_image: string;
    type: number;
    status: number;
}

export interface AgentItemProps {
    name: string,
    description: string,
    cover_image: string,
    id?: string,
    type?: number,
    status?: number,
    onClick?: () => Promise<void>
}

export interface AgentRes extends Agent {
    id: number;
    uuid: string;
    user_uuid: string;
    welcome_info: string;
    parameters: {};
    sample_query: Array<string>
    created_time: string;
    updated_time: string;
}

export interface AgentDetail extends AgentRes {
    spl: string
    spl_form: Array<any>
    spl_chain: Array<any>
    conservations: Array<ConservationRes>;
    knowledge_bases: Array<KnowledgeBaseRes>;
    plugins: Array<PluginRes>;
}

export interface AgentPagination {
    items: Array<AgentRes>;
    links: Array<string>;
    total: number;
    page: number;
    size: number;
    total_pages: number;
}

export interface GetAgentListParam {
    page?: number;
    size?: number;
}

export interface AgentCreateReq {
    name: string;
    description: string;
    cover_image: string;
    status: number;
}

export interface AgentResetPluginsReq {
    plugin_uuids: string[];
}

export interface AgentResetKnowledgeBasesReq {
    knowledge_base_uuids: string[];
}

export interface AgentUpdateReq {
    name?: string;
    description?: string;
    cover_image?: string;
    status?: number;
    spl_form?: Array<any>;
    parameters?: {};
}


export interface AgentState {
    status: 'idle' | 'loading' | 'succeeded' | 'failed';
    generating: boolean;
    processing: number | null;
    compileInfo: string | null;
    error: string | null;
    agents: AgentPagination;
    publicAgents: AgentPagination;
    agentDetail: AgentDetail | null;
}
